$con=mysqli_connect('mountrainierclimbing.dot5hostingmysql.com', 'yearlytotals', 'yearlytotals','yearlytotals');
$routes=array();
$year=$_GET['year'];
if(!isset($_GET['year'])){$year='2015';} else {$year=$_GET['year'];}
$q="SELECT route FROM moraclimbing WHERE date LIKE '%$year%' GROUP BY route ASC";
$qr=mysqli_query($con,$q);
while($rows=mysqli_fetch_array($qr)){
array_push($routes,$rows['route']);
}
?>
Climbing permit system data
Choose a query from the "Menu" above
if($_GET['type']=='allData'){ ?>
# |
Date |
Route |
Size |
Summit |
Leader Zip Code |
$rownums=1;
$totalclimbers=0;
$s="SELECT * FROM moraclimbing WHERE date>'$year-01-01' AND date<'$year-12-31' ORDER BY date ASC";
$r=mysqli_query($con,$s);
while($rows=mysqli_fetch_array($r)){
?>
echo $rownums; ?> |
echo date('F', strtotime($rows['date'])).' ', date('j', strtotime($rows['date'])).', ', date('Y', strtotime($rows['date'])); ?> |
echo $rows['route']; ?> |
echo $rows['size']; $totalclimbers=$totalclimbers+$rows['size']; ?> |
echo $rows['summit']; ?> |
echo $rows['zip']; ?> |
$rownums++; ?>
}
?>
Total Climbers: |
echo $totalclimbers; ?> |
|
}
else{ ?>
Total Climbers Mt. Rainier 2006-2015
![](http://chart.apis.google.com/chart?cht=lc&chco=4D89F9&chs=750x300&chxl=0:<?
$q=)
'2005' GROUP BY YEAR(date) ORDER BY YEAR(date) ASC";
$qr=mysqli_query($con,$q);
$str="|";
while($r=mysqli_fetch_array($qr)){
if($r['year']!=''){
$str.=$r['year'];
$str.="|";
}
}
$str=substr($str,0,-1);
echo $str;
?>
&chd=t:
$q="SELECT YEAR(date) as year, SUM(size) as total FROM moraclimbing WHERE YEAR(date)>'2005' GROUP BY YEAR(date) ORDER BY YEAR(date) ASC";
$max=0;
$str='';
$qr=mysqli_query($con,$q);
while($r=mysqli_fetch_array($qr)){
if($r['total']!=''){
$str.=$r['total'];
$str.=",";
if($r['total']>$max){$max=$r['total'];}
}
}
$str=substr($str, 0, -1);
echo $str;
?>
&chxt=x,y&chds=8500, echo $max; ?>&chxr=1,8500, echo $max; ?>"/>
}
?>